<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
        <meta name="layout" content="main" />
        <g:set var="entityName" value="${message(code: 'vaga.label', default: 'Vaga')}" />
        <title><g:message code="default.create.label" args="[entityName]" /></title>
    </head>
    <body>
        <div class="body">
            <div class="cabelistlateral"><img src="${resource(dir:'images',file:'seta_cabecalho_20x20.png')}" /> Cadastro de Vagas</div><br/>
            <g:form action="save" >
                <div class="dialog dadospessoais">
                    <g:if test="${flash.message}">
                        <div class="message">${flash.message}</div>
                    </g:if>
                    <g:hasErrors bean="${vagaInstance}">
                        <div class="errors erro">
                            <g:renderErrors bean="${vagaInstance}" as="list" />
                        </div>
                    </g:hasErrors>
                    <input type="hidden" name="unidadeConcedente.id" value="${session.pessoa.id}"/>
                    <table>
                        <tbody>
                        
                            <tr class="prop">
                                <td valign="top" class="name">
                                    <label for="cargo"><g:message code="vaga.cargo.label" default="Cargo" /></label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean: vagaInstance, field: 'cargo', 'errors')}">
                                    <g:textField name="cargo" maxlength="200" value="${vagaInstance?.cargo}" />
                                </td>
                            </tr>

                            <tr class="prop">
                                <td valign="top" class="name">
                                    <label for="atividade"><g:message code="vaga.atividade.label" default="Área de Atividade" /></label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean: vagaInstance, field: 'atividade', 'errors')}">
                                    <g:select name="atividade.id" from="${Atividade.list()}" optionKey="id" value="${vagaInstance?.atividade?.id}" optionValue="descricao" noSelection="['':'Selecione']"/>
                                </td>
                            </tr>

                            <tr class="prop">
                                <td valign="top" class="name">
                                    <label for="atribuicoes"><g:message code="vaga.atribuicoes.label" default="Atribuições" /></label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean: vagaInstance, field: 'atribuicoes', 'errors')}">
                                    <g:textArea name="atribuicoes" cols="40" rows="5" value="${vagaInstance?.atribuicoes}" />
                                </td>
                            </tr>
                        
                            <tr class="prop">
                                <td valign="top" class="name">
                                    <label for="perfil"><g:message code="vaga.perfil.label" default="Perfil" /></label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean: vagaInstance, field: 'perfil', 'errors')}">
                                    <g:textArea name="perfil" cols="40" rows="5" value="${vagaInstance?.perfil}" />
                                </td>
                            </tr>
                        
                            <tr class="prop">
                                <td valign="top" class="name">
                                    <label for="observacoes"><g:message code="vaga.observacoes.label" default="Observações" /></label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean: vagaInstance, field: 'observacoes', 'errors')}">
                                    <g:textArea name="observacoes" cols="40" rows="5" value="${vagaInstance?.observacoes}" />
                                </td>
                            </tr>
                        
                            <tr class="prop">
                                <td valign="top" class="name">
                                    <label for="remuneracao"><g:message code="vaga.remuneracao.label" default="Remuneração" /></label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean: vagaInstance, field: 'remuneracao', 'errors')}">
                                    <g:textField name="remuneracao" value="${fieldValue(bean: vagaInstance, field: 'remuneracao')}" />
                                </td>
                            </tr>
                        
                            <tr class="prop">
                                <td valign="top" class="name">
                                    <label for="qtdeVagas"><g:message code="vaga.qtdeVagas.label" default="Quantidade de Vagas" /></label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean: vagaInstance, field: 'qtdeVagas', 'errors')}">
                                    <g:textField name="qtdeVagas" value="${fieldValue(bean: vagaInstance, field: 'qtdeVagas')}" />
                                </td>
                            </tr>
                        
                            <tr class="prop">
                                <td valign="top" class="name">
                                    <label for="chSemanal"><g:message code="vaga.chSemanal.label" default="Carga Horária Semanal" /></label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean: vagaInstance, field: 'chSemanal', 'errors')}">
                                    <g:textField name="chSemanal" value="${fieldValue(bean: vagaInstance, field: 'chSemanal')}" />
                                </td>
                            </tr>
                            <tr>
                              <td></td>
                              <td class="btsalvarcadastro">
                                  <g:submitButton name="create" value="${message(code: 'default.button.create.label', default: 'Create')}"/>
                              </td>
                            </tr>
                        </tbody>
                    </table>
                </div>

            </g:form>
        </div>
    </body>
</html>
